package com.canaan.business.common.enums.basic;

public enum ContainerTypeEnum {
   MATERIAL_FRAME("1", "料框"),
    TRAY("2", "托盘"),
    ;

    private final String code;
    private final String message;

    ContainerTypeEnum(String code, String info) {
        this.code = code;
        this.message = info;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code) {
        if (code == null) {
            return null;
        }
        String message = null;
        for (ContainerTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                message = value.getMessage();
                break;
            }
        }
        return message;
    }


    public static String getCodeByMessage(String message) {
        if (message == null) {
            return null;
        }
        String code = null;
        for (ContainerTypeEnum value : values()) {
            if (value.getMessage().equals(message)) {
                code = value.getCode();
                break;
            }
        }
        return code;
    }
}
